package dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import entities.Apartamento;
import entities.Pessoa;
import exceptions.CPFInvalidoException;
import exceptions.CampoVazioException;
import exceptions.RGInvalidoException;
import exceptions.TamanhoInvalidoException;
import exceptions.TipoNaoPermitidoException;


public interface PessoaDAO {
	public ArrayList<String> listarMoradoresEmApto(String numero, String bloco, boolean recuperarNome, Connection connection) throws SQLException;

	/**
	 * @param cpfLocatario
	 * @param numero
	 * @param bloco
	 * @return
	 */
	public String recuperaCPFFiador(String cpfLocatario, String numero, String bloco, Connection connection)  throws SQLException;

	public void cadastrarMorador(String nome, String endereco, String telefone,
			String celular, String fax, String rg, String cpf, String renda,
			String email, boolean isInquilino, Connection connection) throws CPFInvalidoException, RGInvalidoException,
			CampoVazioException, SQLException, TamanhoInvalidoException, TipoNaoPermitidoException;

	public void atualizarStatus(String cpfLocatario, int status, Connection connection) throws SQLException;
	
	public void excluirPessoa(String cpfLocatario, Connection connection) throws SQLException;

	public ArrayList<String> listarPessoas(boolean isInquilino, int status, Connection connection) throws SQLException;

	public String recuperaCPF(String nome, Connection connection) throws SQLException;

	public ResultSet listarMoradores(String nome, Connection connection) throws SQLException;

	public Pessoa recuperaDadosMorador(String cpf, Connection connection) throws SQLException;

	public void atualizarMorador(String nome, String endereco, String telefone,
			String celular, String fax, String rg, String cpf, String renda,
			String email, boolean ehInquilino, Connection connection) throws SQLException, CPFInvalidoException, RGInvalidoException, CampoVazioException, TamanhoInvalidoException, TipoNaoPermitidoException;

	public void alterarMoradorApto(String cpf, Apartamento aptoOrigem, Apartamento aptoDestino,
			Connection connection) throws SQLException;
}
